/*参加用户记录*/

CREATE TABLE `ymbx729_userinfo` (
	`uin` INT(11) NOT NULL DEFAULT '0',
	`zone_id` SMALLINT(6) NOT NULL DEFAULT '0',
	`account` VARCHAR(40) NOT NULL DEFAULT '',
	`rolename` VARCHAR(40) NOT NULL DEFAULT '',
	`sex` TINYINT(1) NOT NULL DEFAULT '0',
	`reward_1_id` VARCHAR(128) NOT NULL DEFAULT '',
	`reward_3_id` VARCHAR(128) NOT NULL DEFAULT '',
	`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`userip` CHAR(20) NOT NULL DEFAULT '',
	PRIMARY KEY (`uin`,`zone_id`)
)
COLLATE=utf8_general_ci
ENGINE=InnoDB;

/*奖品配置*/
CREATE TABLE `ymbx729_rewardcfg` (
	`id` SMALLINT(6) NOT NULL AUTO_INCREMENT,
	`reward_id` SMALLINT(6) NOT NULL DEFAULT '0' COMMENT '奖品ID',
	`reward_name` VARCHAR(60) NOT NULL DEFAULT '' COMMENT '奖品名称',
	`item_idb` VARCHAR(16) NOT NULL DEFAULT '0' COMMENT '物品ID男',
	`item_idg` VARCHAR(16) NOT NULL DEFAULT '0' COMMENT '物品ID女',
	`item_name` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '物品名称',
	`use_type` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '使用方式（1计时，2计数）',
	`use_day` INT(11) NOT NULL DEFAULT '0' COMMENT '时效/数量',
	`reward_type` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '奖品类型（1小奖，2大奖）',
	`zone_type` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '奖区类型（1元区，3元区）',
	`pic_url` VARCHAR(128) NOT NULL DEFAULT '' COMMENT '奖品图片',
	`rate` FLOAT(11,5) NOT NULL DEFAULT '0.00000' COMMENT '奖品概率',
	PRIMARY KEY (`id`)
)
COLLATE=utf8_general_ci
ENGINE=InnoDB
ROW_FORMAT=COMPACT;


/*中将记录*/
CREATE TABLE `ymbx729_giftlog` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`uin` INT(11) NOT NULL,
	`zone_id` INT(11) NOT NULL,
	`account` VARCHAR(40) NOT NULL DEFAULT '',
	`ip` CHAR(20) NOT NULL DEFAULT '',
	`item_name` VARCHAR(100) NOT NULL DEFAULT '',
	`item_id` VARCHAR(80) NOT NULL DEFAULT '',
	`usemeans` VARCHAR(66) NOT NULL DEFAULT '',
	`quantity` VARCHAR(66) NOT NULL DEFAULT '',
	`status` VARCHAR(66) NOT NULL DEFAULT '0',
	`create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`rolename` VARCHAR(40) NOT NULL DEFAULT '',
	`sex` TINYINT(1) NOT NULL DEFAULT '0',
	`reward_id` SMALLINT(6) NOT NULL DEFAULT '0',
	`reward_type` TINYINT(3) NOT NULL DEFAULT '0',
	`zone_type` TINYINT(1) NOT NULL DEFAULT '0',
	`sign_key` INT(11) NOT NULL DEFAULT '0',
	PRIMARY KEY (`id`),
	INDEX `uin` (`uin`)
)
COLLATE=utf8_general_ci
ENGINE=InnoDB
ROW_FORMAT=COMPACT;

/*扣钱*/
CREATE TABLE `ymbx729_signlog` (
	`id` INT(11) NOT NULL AUTO_INCREMENT,
	`uin` INT(11) NOT NULL DEFAULT '0',
	`zone_id` SMALLINT(6) NOT NULL DEFAULT '0',
	`signtype` TINYINT(3) NOT NULL DEFAULT '0',
	`sign_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
	`status` INT(11) NOT NULL DEFAULT '-1',
	PRIMARY KEY (`id`),
	INDEX `uin` (`uin`)
)
COLLATE=utf8_general_ci
ENGINE=InnoDB;